﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Windows;
using WpfApplication2.Model;
using WpfApplication2.Helper;

namespace WpfApplication2.Commands
{
    public class DisplayCommand:ICommand
    {
        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {            
            var result = parameter as CommandInput<object,object>;
            var employees = result.Input1 as Employees;
            var customers = result.Input2 as Customers;

            Employee emp1 = new Employee();
            
            emp1.EmpID = 1;
            emp1.EmpName="Ashok";
            emp1.EmpAddress="Pondy";
            employees.Add(emp1);
            Employee emp2 = new Employee();
            emp2.EmpID = 2;
            emp2.EmpName = "kumar";
            emp2.EmpAddress = "Bangalore";
            employees.Add(emp2);

            Customer cust1 = new Customer();

            cust1.CusId = 1;
            cust1.CusName = "Asta";
            cust1.CusAddress = "Pondy";
            customers.Add(cust1);

            Customer cust2 = new Customer();
            cust2.CusId = 2;
            cust2.CusName = "Kanchana";
            cust2.CusAddress = "Pondy";
            customers.Add(cust2);

        }
    }
}
